// 更多操作
<template>
  <div class="">
    <n-dropdown trigger="hover" @select="handleSelect" :options="options">
      <span class="sz">更多<i class="iconfont dx-xiala"></i></span>
    </n-dropdown>
  </div>
</template>
<script lang='ts' setup>
import { ref } from "vue";
import { dxget, dxpost, getCodesd, addGuanca, hf } from "../util/index";
import st from "../store/index";
// 1.重点观察   11振幅观察  9到买盘大于60观察  4已买观察  5资讯观察  6财经快讯观察  7淘金观察  8公告观察  3新股观察 10短线助手 12概念龙头 13行业板块 14人气榜单 15 飙升人气榜

const props = defineProps({
  obj: {
    type: Array,
    default: [],
  },
  rowData: {
    type: Object,
    default: [],
  },
});
const emit = defineEmits(["operateFun", "showLoad"]);
const getCs = (data, ty) => {
  return {
    laiyuan: data.type,
    code: data.secCode,
    addTime: data.tradeTime,
    buyPercent: data.buyPercent,
    sellPercent: data.sellPercent,
    observetype: ty,
  };
};
let options = ref([
  // {
  //   label: "历史数据",
  //   key: "0",
  // },

  {
    label: "龙虎榜",
    key: "111",
  },
  ...props.obj,
]);

const handleSelect = async (key) => {
  if (key == "111") {
    hf("winnersList", { code: props.rowData.secCode });
    return;
  }
  let cs: any = getCs(props.rowData, key);
  emit("showLoad");
  st.state.tableLoad = true;
  await addGuanca(props.rowData.secCode, cs.announcementTitle, cs);
  emit("operateFun");
  st.state.tableLoad = false;
};
</script>
<style scoped>
</style>
